home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4626 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: oitnews.harvard.edu!NewsWatcher!user
  2. From: duffyfr@a1.tch.harvard.edu (Frank H. Duffy, MD)
  3. Newsgroups: comp.lang.c
  4. Subject: Unfamiliar DOS functions, help please
  5. Date: Mon, 05 Feb 1996 21:00:04 -0500
  6. Organization: Harvard Medical School
  7. Message-ID: <duffyfr-0502962100040001@134.174.41.144>
  8. NNTP-Posting-Host: 134.174.41.144
  9.  
  10. Am attempting to port software coded in Microsoft C for DOS
  11. over to Unix (Linux using gcc). Don't have access to needed
  12. manuals.
  13.  
  14.    The following code interrupts a data loop with ESC key:
  15.  
  16.    if(kbhit()) {
  17.      if((Key = getch()) == 0)
  18.        Key = getch() + 0x100;
  19.      if(Key == 27)
  20.        return;
  21.    }
  22.  
  23.    Is there a simple way to emulate kbhit in gcc in unix environment?
  24.    Is there a simple way to unblock read of stdin in unix?
  25.    
  26. Thanks for your help. Please respond via e-mail (address below).
  27.  
  28. Frank
  29. ----------------------------------------------------------------
  30. Frank H. Duffy, MD            e-mail: duffyfr@a1.tch.harvard.edu
  31. Neurlogy                      phone: (617)-355-7919
  32. Childrens Hospital &          fax:  (617)-355-7230
  33. Harvard Medical School        ham radio: k1moq
  34. 300 Longwood Ave
  35. Boston, MA 02115 USA
  36.